package com.Redis.Publisher;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class Publisher{
	private final JedisPool jedisPool;

    public Publisher(JedisPool jedisPool) {
        this.jedisPool = jedisPool;
    }

    public void setMessage()
    {
    	 Jedis jedis = jedisPool.getResource();
    	 jedis.publish("reportChannel","StartReport");
    	 System.err.println("发布一个频道");
    }
    
//    public void start() {
//        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//        Jedis jedis = jedisPool.getResource();
//        while (true) {
////                line = reader.readLine();
////                if (!"quit".equals(line)) {
//			jedis.publish("reportChannel","StartReport");
////                } else {
////                    break;
////                }
//         }
//    }

}
